package com.neutech.controller;





import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.neutech.Service.UserService;
import com.neutech.po.User;

@Controller
@RequestMapping("/his")
public class UserController {
@Autowired UserService userService;
	//查询
	@RequestMapping("/getUserById")
	public @ResponseBody User getUser(Integer id){
		User user =userService.getUser(id);
		return user;
	}
	//增加
	@RequestMapping(value="/addUserById",method=RequestMethod.POST)
	public @ResponseBody User addUserById(User user){
		user= userService.addUserById(user);
		return user;
	}
	//删除
	@RequestMapping(value="/deleteUser",method=RequestMethod.POST)
	public  @ResponseBody User deleteUser(User user){
		 user= userService.delectUser(user);
		return user;
	}
	//修改
	@RequestMapping(value="/updateuser",method=RequestMethod.POST)
	public  @ResponseBody User updateuser(User user){
		 user= userService.updateuser(user);
		return user;
	}
}
